Skip to content

Ethernet Test: Dynamic Interface Detection and Robust CI Validation #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smuppand
Copy link
Contributor

This PR enhances the Ethernet validation script:

  • Automatically detects the active Ethernet interface (instead of hardcoding eth0), supporting both ip and ifconfig tools.
  • Adds bring-up logic with retries and detailed logging for interface readiness.
  • Improves ping test logic for more reliable connectivity validation.
  • Adds comprehensive log output to aid CI debugging and result analysis.

These changes make the Ethernet test more portable and robust across diverse hardware and build environments.

@smuppand smuppand requested review from mwasilew and vnarapar June 11, 2025 15:46
@smuppand smuppand force-pushed the eth-dynamic-fix branch 8 times, most recently from f0306d8 to f9a20c2 Compare June 18, 2025 05:43
@smuppand smuppand force-pushed the eth-dynamic-fix branch 7 times, most recently from 797cc1c to c74bdc2 Compare June 20, 2025 16:43
…nd ping validation

- Add logic to auto-detect active Ethernet interface using ip/ipconfig
- Enhance bring-up sequence with retries and logging
- Improve ping test error handling and reporting
- Refactor for better CI diagnostics

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
if [ -z "$ETH_IFACES" ]; then
log_warn "No Ethernet interfaces detected."
echo "No Ethernet interfaces detected." >> "$summary_file"
echo "$TESTNAME SKIP" > "$res_file"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not a failure if /sys/class/net/ is not having any ethernet interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not a failure if /sys/class/net/ is not having any ethernet interfaces

Reason for SKIP:
If the device or platform does not have any Ethernet hardware (i.e., a WiFi-only board, or platform without an Ethernet PHY/port), marking the test as FAIL is misleading—it’s not a test failure, but a non-applicable scenario.

Test Meaning:
SKIP means “test was not applicable or could not be performed due to missing prerequisites.”
FAIL means “test was run, prerequisites were met, but the result did not match expectations.”


if ! is_interface_up "$iface"; then
log_warn "$iface is DOWN, skipping"
echo "$iface: SKIP (down/no cable)" >> "$summary_file"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see an entry to check the cable aswell.
Do you think it is required to add that aswell
sh-5.2# cat /sys/class/net/eth0/carrier
0
0 - if cable is not present

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see an entry to check the cable aswell. Do you think it is required to add that aswell sh-5.2# cat /sys/class/net/eth0/carrier 0 0 - if cable is not present

As far as I know, it is not needed. Lava CI debugging is happening only on the serial logs, and no other device logs will be seen. The stdout is sufficient for debugging.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can save additional logs if required. This is done over networks, so if there is no network it won't work. Example here https://github.com/Linaro/test-definitions/blob/master/automated/utils/upload-to-artifactorial.sh

I'd say if the additional debugging is helpful for manual testing it should be kept.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What additional logs are required for debugging? I can save them to the location. If dmesg logs are sufficient to debug the initial failures, which are already available in the job.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no mandatory requirement. Additional debug should be something useful from your pov or sth requested by maintainers. What I'm trying to say is that you can include the $summary_file in the code. There is no harm doing that. If it's not used in LAVA that's OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary_file will still be available, it is not being removed. We can capture everything needed from network maintainers to log into the summary based on the requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants